home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / layout / nsIScrollableFrame.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  123 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsIScrollFrame_h___
  39. #define nsIScrollFrame_h___
  40.  
  41. #include "nsISupports.h"
  42. #include "nsCoord.h"
  43. #include "nsIViewManager.h"
  44. #include "nsIScrollableViewProvider.h"
  45. #include "nsPresContext.h"
  46. #include "nsIFrame.h" // to get nsIBox, which is a typedef
  47.  
  48. class nsBoxLayoutState;
  49.  
  50. // IID for the nsIScrollableFrame interface
  51. #define NS_ISCROLLABLE_FRAME_IID    \
  52. { 0xf285c180, 0x8492, 0x48d5, \
  53. { 0xb1, 0xb5, 0x03, 0x28, 0x21, 0xc9, 0x72, 0x02 } }
  54.  
  55. class nsIScrollableFrame : public nsIScrollableViewProvider {
  56. public:
  57.  
  58.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCROLLABLE_FRAME_IID)
  59.  
  60.   /**
  61.    * Get the frame that we are scrolling within the scrollable frame.
  62.    * @result child frame
  63.    */
  64.   virtual nsIFrame* GetScrolledFrame() const = 0;
  65.  
  66.   typedef nsPresContext::ScrollbarStyles ScrollbarStyles;
  67.  
  68.   virtual ScrollbarStyles GetScrollbarStyles() const = 0;
  69.  
  70.   /**
  71.    * Return the actual sizes of all possible scrollbars. Returns 0 for scrollbar
  72.    * positions that don't have a scrollbar or where the scrollbar is not visible.
  73.    * Do not call this while this frame's descendants are being reflowed, it won't be
  74.    * accurate.
  75.    */
  76.   virtual nsMargin GetActualScrollbarSizes() const = 0;
  77.  
  78.   /**
  79.    * Return the sizes of all scrollbars assuming that any scrollbars that could
  80.    * be visible due to overflowing content, are.
  81.    */
  82.   virtual nsMargin GetDesiredScrollbarSizes(nsBoxLayoutState* aState) = 0;
  83.  
  84.   /**
  85.    * Get the position of the scrolled view.
  86.    */
  87.   virtual nsPoint GetScrollPosition() const = 0;
  88.  
  89.   /**
  90.    * Scroll the view to the given x,y, update's the scrollbar's thumb
  91.    * positions and the view's offset. Clamps the values to be
  92.    * legal. Updates the display based on aUpdateFlags.
  93.    * @param aX left edge to scroll to
  94.    * @param aY top edge to scroll to
  95.    * @param aUpdateFlags passed onto nsIViewManager->UpdateView()
  96.    * @return error status
  97.    */
  98.   virtual void ScrollTo(nsPoint aScrollPosition, PRUint32 aFlags = NS_VMREFRESH_NO_SYNC)=0;
  99.  
  100.   virtual nsIScrollableView* GetScrollableView() = 0;
  101.  
  102.   /**
  103.    * Set information about whether the vertical and horizontal scrollbars
  104.    * are currently visible
  105.    */
  106.   virtual void SetScrollbarVisibility(PRBool aVerticalVisible, PRBool aHorizontalVisible) = 0;
  107.  
  108.   virtual nsIBox* GetScrollbarBox(PRBool aVertical) = 0;
  109.  
  110.   virtual void CurPosAttributeChanged(nsIContent* aChild, PRInt32 aModType) = 0;
  111.  
  112.   /**
  113.    * This tells the scroll frame to try scrolling to the scroll
  114.    * position that was restored from the history. This must be called
  115.    * at least once after state has been restored. It is called by the
  116.    * scrolled frame itself during reflow, but sometimes state can be
  117.    * restored after reflows are done...
  118.    */
  119.   virtual void ScrollToRestoredPosition() = 0;
  120. };
  121.  
  122. #endif
  123.